<template>
    <div class="bigdata">
        <div class="wf-chart-wraper">
            <wfChartBox :data="arrayData"
                        :id="'bigdata'" />
        </div>

        <dataLoader :show="showDataLoader"
                    @close="_closeDataLoader"
                    @confirm="loadArrayData" />

        <div class="btn-data"
             @click="_showDataLoader">载入数据</div>
    </div>
</template>

<script>
import wfChartBox from "@/components/wfChart/index.vue";
import dataLoader from "@/components/common/dataLoader/index.vue"
export default {
    name: "bigdata",
    components: {
        // wfChart,
        wfChartBox,
        dataLoader
    },
    props: {},
    data () {
        return {
            arrayData: [],
            showDataLoader: false
        };
    },
    computed: {},
    methods: {
        loadArrayData (array) {
            this.arrayData = array
            this._closeDataLoader()
        },
        _showDataLoader () {
            this.showDataLoader = true
        },
        _closeDataLoader () {
            this.showDataLoader = false
        }
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.bigdata {
    position: relative;
    flex: 1 1 auto;
    height: 100vh;
    display: flex;
    flex-wrap: wrap;

    .wf-chart-wraper {
        width: 100%;
        height: 80vh;
        padding: 2vw;
        box-sizing: border-box;
    }

    .btn-data {
        cursor: pointer;
        background: #07c160;
        color: #fff;
        padding: 12px 20px;
        position: fixed;
        bottom: 10vh;
        left: 50%;
    }
}
</style>
